package lc.q151_200;

public class Q154 {

    public int findMin(int[] nums) {
        // 这个题的思路根153类似，增加一种特例要考虑
        int low = 0, high = nums.length - 1;

        while (low < high) {
            int pivot = low + (high - low) / 2;
            if (nums[pivot] < nums[high])
                high = pivot;
            else if (nums[pivot] > nums[high])
                low = pivot + 1;
            else
                high -= 1;
        }
        return nums[low];
    }
}
